import http from "../utils/request"
/**
 * @获取验证码
 */

//获取登入验证码
export let getCaptcha =()=>http.get("/users/getCaptcha?v=next");

//常规登入
export let loginApi = (username,password)=>http.post("/users/login",{
     username,
     password
});

//校验验证码/users/verifyCaptcha
//params 就是简写模式吧？？先这样理解
export  let verifyCaptcha = (captcha) => http.get("/users/verifyCaptcha",{
    params:{
        captcha
    }
})

//获取二维码地址/users/getQrcode	
export let getQrcodeApi = (sid)=> http.get("/users/getQrcode",{
    params:{
        sid
    }
})

//定义微信扫码登入
/**
 *@微信扫码登入接口
 *@/users/wechatLogin
 *@传参数wechatCode	
 */
export let wechatLoginApi= wechatCode => http.get("/users/wechatLogin",{
    params:{
        wechatCode
    }
})

/**
 * @获取手机验证码
 * /sms/send
 * @参数 [phoneNumber]
 */
export let phoneSend =  phoneNumber => http.post("/sms/send",{
    phoneNumber
})
/**
 * @手机验证码登入
 * /users/login?type=sms
 * @参数   code [手机号]
 * 
 */

export let phoneLongin =  code => http.post("/users/login?type=sms",{
    code
})